#region Using Statements
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using JigLibX.Collision;
using JigLibX.Physics;
using JigLibX.Geometry;
using JigLibX.Math;
using Microsoft.Xna.Framework.Graphics;
using SqEngine.Components;
using sqengine.Components;
using sqengine.Engine.Common;
#endregion

namespace sqengine.PhysicObjects
{
    public class BoxObject : BasicObject
    {        
        public BoxObject(Game game, string ObjName, Model model, Vector3 sideLengths, Matrix orientation, Vector3 position, string filename)
            : base(game, model,filename)
        {
            body = new Body();
            Name = ObjName;

            collision = new CollisionSkin(body);
          
            collision.AddPrimitive(new Box(-0.5f * sideLengths, orientation, sideLengths), new MaterialProperties(0.8f, 0.8f, 0.7f));
            body.CollisionSkin = this.collision;
            Vector3 com = SetMass(1.0f);
            body.MoveTo(position, Matrix.Identity);
            collision.ApplyLocalTransform(new Transform(-com, Matrix.Identity));
            body.EnableBody();
            this.Scale = sideLengths;
        }

        public override void ApplyEffects(BasicEffect effect)
        {
            
        }

        public void SetScale(float obj_scale)
        {
            this.Scale = Vector3.One * obj_scale;
        }

        public override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);
        }
    }
}


